<?php
	require_once("sorttools.php");
	$tool = new SortTool();
	$sourarr = [];
	$size = 10000;
	for ($i=0; $i < $size; $i++) { 
		# code...
		$x =  rand ( 0, $size );
		array_push($sourarr,$x);
	}
	//var_dump($sourarr);
	//
	
	 // list($msec, $sec) = explode(' ', microtime());
	 // $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);


	//print_r($sourarr);
	$tInt_1 = (int)(microtime(true)*1000);
	$return = $tool->bubbleSort($sourarr);
	$tInt_2 = (int)(microtime(true)*1000);

	echo '耗时:'.($tInt_2 -$tInt_1);




	//print_r($return);
	//
	//
	// function microtime_float()
	// {
	//     list($usec, $sec) = explode(" ", microtime());
	//     return ((float)$usec + (float)$sec);
	// }

	// $t1 = microtime_float();
	// $t2 = microtime(false);
	// $t3 = microtime(true);
	// $tInt = (int)(microtime(true)*1000);
	// echo "t1 = $t1<p> t2 = $t2 <p> t3 = $t3 <p>";
	// echo "tInt = $tInt <p>";
?>